﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Drawing;

public partial class PcPart : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        lblText1.Text = Request.QueryString["id1"];
        lblText2.Text = Request.QueryString["id2"];
        lblText3.Text = Request.QueryString["id3"];
        lblText4.Text = Request.QueryString["id4"];
        lblText5.Text = Request.QueryString["id5"];
        lblText6.Text = Request.QueryString["id6"];
        lblText7.Text = Request.QueryString["id7"];
        lblText8.Text = Request.QueryString["id8"];
        lblText9.Text = Request.QueryString["id9"];
        lblText10.Text = Request.QueryString["id10"];
        lblText11.Text = Request.QueryString["id11"];
        lblText12.Text = Request.QueryString["id12"];
        if (!Page.IsPostBack)
        {
            if (lblText1.Text == Request.QueryString["id1"])
                fill1();
            else if (lblText2.Text == Request.QueryString["id2"])
                fill2();
            else if (lblText3.Text == Request.QueryString["id3"])
                fill3();
            else if (lblText4.Text == Request.QueryString["id4"])
                fill4();
            else if (lblText5.Text == Request.QueryString["id5"])
                fill5();
            else if (lblText6.Text == Request.QueryString["id6"])
                fill6();
            else if (lblText7.Text == Request.QueryString["id7"])
                fill7();
            else if (lblText8.Text == Request.QueryString["id8"])
                fill8();
            else if (lblText9.Text == Request.QueryString["id9"])
                fill9();
            else if (lblText10.Text == Request.QueryString["id10"])
                fill10();
            else if (lblText11.Text == Request.QueryString["id11"])
                fill11();
            else if (lblText12.Text == Request.QueryString["id12"])
                fill12();

            btnNazad.Enabled = false;
        }
    }

    protected void fill1()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM monitor";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "monitor");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_monitor()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM monitor WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "monitor");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill2()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM pccase";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "pccase");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_pccase()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM pccase WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "pccase");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill3()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM psu";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "psu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_psu()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM psu WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "psu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill4()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM mb";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "mb");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_mb()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM mb WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "mb");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill5()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM cpu";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "cpu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_cpu()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM cpu WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "cpu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill6()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM gpu";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "gpu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_gpu()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM gpu WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "gpu");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill7()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM ram";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "ram");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_ram()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM ram WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "ram");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill8()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM hdd";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "hdd");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_hdd()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM hdd WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "hdd");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill9()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM odd";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "odd");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_odd()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM odd WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "odd");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill10()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM keyboard";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "keyboard");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_keyboard()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM keyboard WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "keyboard");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill11()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM mouse";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "mouse");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_mouse()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM mouse WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "mouse");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill12()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM netequipment";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "netequipment");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void fill_netequipment()
    {
        SqlConnection konekcija = new SqlConnection();
        konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
        string sqlstring = "SELECT * FROM netequipment WHERE Proizvod LIKE ('%" + txtSearch.Text + "%') OR Kategorija LIKE ('%" + txtSearch.Text + "%') OR Sifra LIKE ('%" + txtSearch.Text + "%')";
        SqlCommand komanda = new SqlCommand(sqlstring, konekcija);
        SqlDataAdapter adapter = new SqlDataAdapter(komanda);
        DataSet ds = new DataSet();
        try
        {
            konekcija.Open();
            adapter.Fill(ds, "netequipment");
            GridView1.DataSource = ds;
            GridView1.DataBind();
            ViewState["dataset"] = ds;
        }
        catch (Exception err)
        {
            lblError.Text = err.Message;
        }
        finally
        {
            konekcija.Close();
        }
    }

    protected void btnSite_Click(object sender, EventArgs e)
    {
        GridView1.AllowPaging = false;
        btnSite.Enabled = false;
        btnNazad.Enabled = true;
        if (lblText1.Text == Request.QueryString["id1"])
            fill1();
        else if (lblText2.Text == Request.QueryString["id2"])
            fill2();
        else if (lblText3.Text == Request.QueryString["id3"])
            fill3();
        else if (lblText4.Text == Request.QueryString["id4"])
            fill4();
        else if (lblText5.Text == Request.QueryString["id5"])
            fill5();
        else if (lblText6.Text == Request.QueryString["id6"])
            fill6();
        else if (lblText7.Text == Request.QueryString["id7"])
            fill7();
        else if (lblText8.Text == Request.QueryString["id8"])
            fill8();
        else if (lblText9.Text == Request.QueryString["id9"])
            fill9();
        else if (lblText10.Text == Request.QueryString["id10"])
            fill10();
        else if (lblText11.Text == Request.QueryString["id11"])
            fill11();
        else if (lblText12.Text == Request.QueryString["id12"])
            fill12();
    }
    protected void btnNazad_Click(object sender, EventArgs e)
    {
        GridView1.AllowPaging = true;
        btnSite.Enabled = true;
        btnNazad.Enabled = false;
        if (lblText1.Text == Request.QueryString["id1"])
            fill1();
        else if (lblText2.Text == Request.QueryString["id2"])
            fill2();
        else if (lblText3.Text == Request.QueryString["id3"])
            fill3();
        else if (lblText4.Text == Request.QueryString["id4"])
            fill4();
        else if (lblText5.Text == Request.QueryString["id5"])
            fill5();
        else if (lblText6.Text == Request.QueryString["id6"])
            fill6();
        else if (lblText7.Text == Request.QueryString["id7"])
            fill7();
        else if (lblText8.Text == Request.QueryString["id8"])
            fill8();
        else if (lblText9.Text == Request.QueryString["id9"])
            fill9();
        else if (lblText10.Text == Request.QueryString["id10"])
            fill10();
        else if (lblText11.Text == Request.QueryString["id11"])
            fill11();
        else if (lblText12.Text == Request.QueryString["id12"])
            fill12();
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        lblText.ForeColor = Color.FromName("Green");
        lblText.Text = "Го селектиравте производот " + GridView1.SelectedRow.Cells[2].Text;
    }
    protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        DataSet ds = (DataSet)ViewState["dataset"];
        GridView1.EditIndex = -1;
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        DataSet ds = (DataSet)ViewState["dataset"];
        GridView1.EditIndex = e.NewEditIndex;
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        if (lblText1.Text == Request.QueryString["id1"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE monitor SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill1();
        }
        else if (lblText2.Text == Request.QueryString["id2"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE pccase SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill2();
        }
        else if (lblText3.Text == Request.QueryString["id3"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE psu SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill3();
        }
        else if (lblText4.Text == Request.QueryString["id4"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE mb SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill4();
        }
        else if (lblText5.Text == Request.QueryString["id5"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE cpu SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill5();
        }
        else if (lblText6.Text == Request.QueryString["id6"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE gpu SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill6();
        }
        else if (lblText7.Text == Request.QueryString["id7"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE ram SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill7();
        }

        else if (lblText8.Text == Request.QueryString["id8"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE hdd SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill8();
        }

        else if (lblText9.Text == Request.QueryString["id9"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE odd SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill9();
        }

        else if (lblText10.Text == Request.QueryString["id10"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE keyboard SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill10();
        }

        else if (lblText11.Text == Request.QueryString["id11"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE mouse SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill11();
        }

        else if (lblText12.Text == Request.QueryString["id12"])
        {


            SqlConnection konekcija = new SqlConnection();
            konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
            string sqlstring = "UPDATE netequipment SET Cena=@Cena, ParcinjaVoZaliha=@ParcinjaVoZaliha, ParcinjaVoNaracka=@ParcinjaVoNaracka WHERE Sifra=@Sifra";
            SqlCommand komanda = new SqlCommand(sqlstring, konekcija);

            TextBox tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[3].Controls[0];
            komanda.Parameters.AddWithValue("@Cena", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[4].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoZaliha", tb.Text);
            tb = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].Controls[0];
            komanda.Parameters.AddWithValue("@ParcinjaVoNaracka", tb.Text);
            komanda.Parameters.AddWithValue("@Sifra", GridView1.Rows[e.RowIndex].Cells[1].Text);
            int efekt = 0;
            try
            {
                konekcija.Open();
                efekt = komanda.ExecuteNonQuery();
            }
            catch (Exception err)
            {
                lblError.ForeColor = Color.FromName("Red");
                lblError.Text = err.Message;
            }
            finally
            {
                konekcija.Close();
                GridView1.EditIndex = -1;
            }
            if (efekt != 0)
                lblText.Text = " ";
            fill12();
        }

    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        lblText.Text = "";
        GridView1.PageIndex = e.NewPageIndex;
        GridView1.SelectedIndex = -1;
        DataSet ds = (DataSet)ViewState["dataset"];
        GridView1.DataSource = ds;
        GridView1.DataBind();
    }
    protected void btnVnesi_Click(object sender, EventArgs e)
    {
        Response.Redirect("InsertPcPart.aspx");
    }
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        if (lblText1.Text == Request.QueryString["id1"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM monitor WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill1();
        }
        else if (lblText2.Text == Request.QueryString["id2"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM pccase WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill2();
        }
        else if (lblText3.Text == Request.QueryString["id3"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM psu WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill3();
        }
        else if (lblText4.Text == Request.QueryString["id4"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM mb WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill4();
        }
        else if (lblText5.Text == Request.QueryString["id5"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM cpu WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill5();
        }
        else if (lblText6.Text == Request.QueryString["id6"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM gpu WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill6();
        }
        else if (lblText7.Text == Request.QueryString["id7"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM ram WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill7();
        }

        else if (lblText8.Text == Request.QueryString["id8"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM hdd WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill8();
        }

        else if (lblText9.Text == Request.QueryString["id9"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM odd WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill9();
        }

        else if (lblText10.Text == Request.QueryString["id10"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM keyboard WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill10();
        }

        else if (lblText11.Text == Request.QueryString["id11"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM mouse WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill11();
        }

        else if (lblText12.Text == Request.QueryString["id12"])
        {
            if (GridView1.SelectedIndex != -1)
            {
                SqlConnection konekcija = new SqlConnection();
                konekcija.ConnectionString = ConfigurationManager.ConnectionStrings["mojaKonekcija"].ConnectionString;
                SqlCommand komanda = new SqlCommand();
                komanda.Connection = konekcija;
                komanda.CommandText = "DELETE FROM netequipment WHERE Sifra='" + GridView1.SelectedValue + "'";

                try
                {
                    konekcija.Open();
                    komanda.ExecuteNonQuery();
                    lblText.ForeColor = Color.FromName("Green");
                    lblText.Text = "Производот е избришан!";
                }
                catch (Exception err)
                {
                    lblText.ForeColor = Color.FromName("Red");
                    lblText.Text = err.Message;
                }
                finally
                {
                    konekcija.Close();
                }
            }
            else
            {
                lblText.ForeColor = Color.FromName("Red");
                lblText.Text = "Селектирајте производ!";
            }
            fill12();
        }
    }
    protected void btnBaraj_Click(object sender, EventArgs e)
    {
        if (lblText1.Text == Request.QueryString["id1"])
            fill_monitor();
        else if (lblText2.Text == Request.QueryString["id2"])
            fill_pccase();
        else if (lblText3.Text == Request.QueryString["id3"])
            fill_psu();
        else if (lblText4.Text == Request.QueryString["id4"])
            fill_mb();
        else if (lblText5.Text == Request.QueryString["id5"])
            fill_cpu();
        else if (lblText6.Text == Request.QueryString["id6"])
            fill_gpu();
        else if (lblText7.Text == Request.QueryString["id7"])
            fill_ram();
        else if (lblText8.Text == Request.QueryString["id8"])
            fill_hdd();
        else if (lblText9.Text == Request.QueryString["id9"])
            fill_odd();
        else if (lblText10.Text == Request.QueryString["id10"])
            fill_keyboard();
        else if (lblText11.Text == Request.QueryString["id11"])
            fill_mouse();
        else if (lblText12.Text == Request.QueryString["id12"])
            fill_netequipment();
    }
}